//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#ifndef Green_PagingInfo_H
#define Green_PagingInfo_H

#include ARCH_ENUM_HEADER

#include <map>
#include <string>

namespace Green {

  class PteStructure;
  class ArchInfo;

  /*!
    \class PagingInfo
    \brief Info class for the paging system.

    PagingInfo handles parsing of all paging files and retain necessary information for the paging system.
  */

  class PagingInfo {
  public:
    PagingInfo(): mPagingMode(EPagingMode(0)), mPteSet() { } //!< Constructor.
    virtual ~PagingInfo(); //!< Destructor.

    void Setup(const ArchInfo& archInfo); //!< Setup PagingInfo container, load paging files.
    EPagingMode GetPagingMode() const { return mPagingMode; } //!< Get paging mode.
    const PteStructure* LookUpPte(const std::string& pteName) const; //!< Look up PteStructure object by PTE ID.
  protected:
    void AddPte(PteStructure* pteStruct); //!< Add a new instance of PteStructure.

  private:
    EPagingMode mPagingMode; //!< Paging mode
    std::map<std::string, PteStructure* > mPteSet; //!< Map containing all PteStructure objects.
    friend class PagingParser;
  };

}

#endif
